package com.jzg.jcptadmin.adpter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.jzg.jcptadmin.ui.fragment.EstimateFragment;
import com.jzg.jcptadmin.ui.fragment.QueryVinFragment;

/**
 * Created by wangyd on 15/12/28.
 */
public class SectionsPagerAdapter extends FragmentPagerAdapter {
    public static final int ONE_PAGE = 0;
    public static final int TWO_PAGE = 1;

    public static final int TOTAL_PAGE = 2;

    public SectionsPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        switch (position) {
            case ONE_PAGE:
                return new EstimateFragment();
            case TWO_PAGE:
                return new QueryVinFragment();
            default:
                return new EstimateFragment();
        }
//        return null;
    }

    @Override
    public int getCount() {
        // Show 2 total pages.
        return TOTAL_PAGE;
    }

//    @Override
//    public CharSequence getPageTitle(int position) {
//        switch (position) {
//            case 0:
//                return "SECTION 1";
//            case 1:
//                return "SECTION 2";
//        }
//        return null;
//    }
}
